<template>
  <div class="pageContent">
    <div class="inner-padding pt50">
      <a-item />
      <a-bottom />
    </div>

  </div>
</template>
<script>
import { onMounted, ref, computed, watch, inject, reactive, toRef, toRefs } from 'vue'
import AItem from './components/a-item'
import ABottom from './components/a-bottom'
import { useRoute, useRouter, onBeforeRouteUpdate  } from "vue-router";
import { useStore } from "vuex";
import { testApi } from "@/api";

export default {
  components: {
    AItem,
    ABottom
  },
  setup(props){
    const store = useStore()
    const params = ref()
    const reload = inject('reload')
    let list = reactive([])

    onMounted(()=>{
    })

    onBeforeRouteUpdate( (to, from) => {
      // params.value = to.params
      reload()
    });
    testApi().then(res=>{
      list.push(...res.data)
    })

    return {
      list
    }
  }
}
</script>
<style lang="less" scoped>

.inner-padding{
  width: 100%;
}
</style>